//package com.project.stream_producer.demo2.service.impl;
//
//import com.project.stream_producer.demo2.service.MessageProducer;
//import org.springframework.cloud.stream.annotation.EnableBinding;
//import org.springframework.cloud.stream.messaging.Source;
//import org.springframework.messaging.MessageChannel;
//import org.springframework.messaging.support.MessageBuilder;
//
//import javax.annotation.Resource;
//
//@EnableBinding(Source.class)
//public class MessageProducerImpl implements MessageProducer {
//    @Resource
//    private MessageChannel output;//消息发送管道
//
//    @Override
//    public boolean send(String num) {
//        boolean send = output.send(MessageBuilder.withPayload(num).build());
//        return send;
//    }
//}
